package com.prj.ufdm.cloud; 

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class UfdmGatewayApplication implements EnvironmentAware  {
	
	private static Environment env; 
	
	public static void main(String[] args) { 
		
		SpringApplication.run(UfdmGatewayApplication.class, args); 
		
		System.out.println("\n UfdmGatewayApplication "+ env.getProperty("server.port") +" 启动成功................");
		
	}
	
	@Override
	public void setEnvironment(Environment environment) {
		env = environment;
	}
	
	@RequestMapping("/hystrixfallback")
	@ResponseBody
	public String hystrixfallback() {
		return "This is a fallback";
	}
}
